package com.greendragon.service.frontend.impl; 

import java.util.List;

import com.greendragon.persistence.dao.ICategoryDao;
import com.greendragon.persistence.domain.ArticalCategory;
import com.greendragon.persistence.enmu.FetchOrderType;
import com.greendragon.service.frontend.ICategoryFrontendService;

/** 
 * @author wulibin, exceptsky@gmail.com, 2011-11-9 下午01:28:17
 * 
 */
public class ArticalCategoryFrontendService extends BaseFrontendService<ArticalCategory> implements ICategoryFrontendService<ArticalCategory>{
	private ICategoryDao<ArticalCategory> categoryDao;
	
	@Override
	public List<ArticalCategory> getAllRootCategories(int page) {
		return categoryDao.getAllRootCategories(page*pageLength, pageLength, FetchOrderType.CREATE_DESC);
	}

	@Override
	public ArticalCategory getByName(String name) {
		return categoryDao.getByName(name);
	}

	public void setCategoryDao(ICategoryDao<ArticalCategory> categoryDao) {
		this.categoryDao = categoryDao;
		this.setDao(categoryDao);
	}
}
 